import { HttpClient } from '@angular/common/http';
import { Component } from '@angular/core';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss']
})
export class Tab1Page {
  res: Result;
  constructor(private http: HttpClient) { }
  ngOnInit(): void {
    let url = 'http://101.96.128.94:9999/data/product/index.php';
    this.http.get(url).subscribe(
      (res: Result) => {
        this.res = res;
      }
    )
  }
}
interface Result {
  carouselItem: CarouselItem[];
  newArrivalItem: ResultItem[];
  recommendItem: ResultItem[];
  topSaleItem: ResultItem[];
}
interface CarouselItem {
  cid: string;
  href: string;
  img: string;
  title: string;
}
interface ResultItem {
  detail: string;
  href: string;
  pic: string;
  price: string;
  title: string;
}